#!/usr/bin/env bash
echo "mvn start >>>"
mvn clean
mvn install
echo "mvn end."
echo "make image start..."
image_tag=`date +%Y%m%d` #_%H%M
echo "当前时间：$image_tag"
docker build -t registry.cn-shanghai.aliyuncs.com/alphainsight_kpmg/xiyu_java_zuul:v${image_tag} .
echo "make image success!"
docker push registry.cn-shanghai.aliyuncs.com/alphainsight_kpmg/xiyu_java_zuul:v${image_tag}
echo "镜像版本保存"
docker tag registry.cn-shanghai.aliyuncs.com/alphainsight_kpmg/xiyu_java_zuul:v${image_tag} registry.cn-shanghai.aliyuncs.com/alphainsight_kpmg/xiyu_java_zuul:latest
docker push registry.cn-shanghai.aliyuncs.com/alphainsight_kpmg/xiyu_java_zuul:latest
echo "删除本地镜像"
docker rmi registry.cn-shanghai.aliyuncs.com/alphainsight_kpmg/xiyu_java_zuul:v${image_tag}